import Vue from 'vue'
import Router from 'vue-router'
import Layout from './components/Layout.vue'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/layout/list'
    },
    {
      path: '/layout',
      name: 'list',
      component: Layout,
      children: [
        {
          path: 'list',
          component: () => import('./views/List.vue')
        },
        {
          path: 'level2Add/:i',
          component: () => import('./views/Level2Add.vue')
        },
        {
          path: 'export/:i',
          component: () => import('./views/ExportZip.vue')
        },
        {
          path: 'setting',
          component: () => import('./views/Setting.vue')
        }
      ]
    },
    {
      path: '/addTask',
      component: () => import('./views/AddTask.vue')
    },
    {
      path: '/listDetail/:i',
      component: () => import('./views/listDetail.vue')
    }
  ]
})
